export interface severType {
  label?: string
  value?: string
  data?: any[]
  list?: () => void // 根据实际需求调整函数签名
  req?: any
  [propName: string]: any
}

export interface stateType {
  data: dataType
}

export interface dataType {
  attr: any
  form?: any
  info?: any
  serverOptions?: severType
  options?: any[]
  [propName: string]: any
}

export const initState = (attrs: any) => {
  const state: any = {}
  state.attr = attrs.attr
  state.serverOptions = attrs.serverOption
  state.form = attrs.formItem
  state.fn = attrs.fn ?? {}
  return state
}
